Geospatial example

Rather than doing some of your work in Stata and some of your work in ArcGIS, you can do a lot of it in Python. The geopandas package is the geospatial version of the pandas package, and allows you do perform spatial operations, including drawing buffers, calculating distances, calculating areas, spatial joins, etc.

We'll do a quick example of merging our tabular data with geospatial. Often, we have a table of values we'd like to map. We need polygons attached to our geography, and then we want to quickly visualize. Our quick example will do a little bit of cleaning using pandas, merge on the polygon geometry, then plot the map (static and interactive map) using geopandas (static map) and folium (interactive map).

Resources:

Quickly, we'll grab the CA county boundaries from CA Open Data Portal.

https://gis.data.ca.gov/datasets/CALFIRE-Forestry::california-county-boundaries/data

Navigate to API > GeoJSON, and copy the URL.

Merging

Plot a map